home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / zrop.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.8 KB  |  116 lines

  1. /* Copyright (C) 1995, 1996, 1998, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: zrop.c,v 1.2 2000/09/19 19:00:55 lpd Exp $ */
  20. /* RasterOp control operators */
  21. #include "memory_.h"
  22. #include "ghost.h"
  23. #include "oper.h"
  24. #include "gsrop.h"
  25. #include "gsutil.h"
  26. #include "gxdevice.h"
  27. #include "idict.h"
  28. #include "idparam.h"
  29. #include "igstate.h"
  30. #include "store.h"
  31.  
  32. /* <int8> .setrasterop - */
  33. private int
  34. zsetrasterop(i_ctx_t *i_ctx_p)
  35. {
  36.     os_ptr op = osp;
  37.     int param;
  38.     int code = int_param(op, 0xff, ¶m);
  39.  
  40.     if (code < 0)
  41.     return code;
  42.     gs_setrasterop(igs, (gs_rop3_t)param);
  43.     pop(1);
  44.     return 0;
  45. }
  46.  
  47. /* - .currentrasterop <int8> */
  48. private int
  49. zcurrentrasterop(i_ctx_t *i_ctx_p)
  50. {
  51.     os_ptr op = osp;
  52.  
  53.     push(1);
  54.     make_int(op, (int)gs_currentrasterop(igs));
  55.     return 0;
  56. }
  57.  
  58. /* <bool> .setsourcetransparent - */
  59. private int
  60. zsetsourcetransparent(i_ctx_t *i_ctx_p)
  61. {
  62.     os_ptr op = osp;
  63.  
  64.     check_type(*op, t_boolean);
  65.     gs_setsourcetransparent(igs, op->value.boolval);
  66.     pop(1);
  67.     return 0;
  68. }
  69.  
  70. /* - .currentsourcetransparent <bool> */
  71. private int
  72. zcurrentsourcetransparent(i_ctx_t *i_ctx_p)
  73. {
  74.     os_ptr op = osp;
  75.  
  76.     push(1);
  77.     make_bool(op, gs_currentsourcetransparent(igs));
  78.     return 0;
  79. }
  80.  
  81. /* <bool> .settexturetransparent - */
  82. private int
  83. zsettexturetransparent(i_ctx_t *i_ctx_p)
  84. {
  85.     os_ptr op = osp;
  86.  
  87.     check_type(*op, t_boolean);
  88.     gs_settexturetransparent(igs, op->value.boolval);
  89.     pop(1);
  90.     return 0;
  91. }
  92.  
  93. /* - .currenttexturetransparent <bool> */
  94. private int
  95. zcurrenttexturetransparent(i_ctx_t *i_ctx_p)
  96. {
  97.     os_ptr op = osp;
  98.  
  99.     push(1);
  100.     make_bool(op, gs_currenttexturetransparent(igs));
  101.     return 0;
  102. }
  103.  
  104. /* ------ Initialization procedure ------ */
  105.  
  106. const op_def zrop_op_defs[] =
  107. {
  108.     {"0.currentrasterop", zcurrentrasterop},
  109.     {"0.currentsourcetransparent", zcurrentsourcetransparent},
  110.     {"0.currenttexturetransparent", zcurrenttexturetransparent},
  111.     {"1.setrasterop", zsetrasterop},
  112.     {"1.setsourcetransparent", zsetsourcetransparent},
  113.     {"1.settexturetransparent", zsettexturetransparent},
  114.     op_def_end(0)
  115. };
  116.